using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.Design;
using EntLibContrib.Validation.Design.UI;
using System.Windows.Forms;

namespace EntLibContrib.Validation.Design
{
    class AddTypeFromStringNodeCommand : AddTypeNodeCommand
    {
        public AddTypeFromStringNodeCommand(IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
        }

        protected override Type SelectedType
        {
            get
            {
                using (TypeNameUI dialog = new TypeNameUI())
                {
                    if (DialogResult.OK == dialog.ShowDialog())
                    {
                        return dialog.Type;
                    }
                }
                return null;
            }
        }
    }
}
